3.195 \(\int \cot ^2(e+f x) (a+b \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=21 \[ x (-(a-b))-\frac{a \cot (e+f x)}{f} \]

[Out]

-((a - b)*x) - (a*Cot[e + f*x])/f

________________________________________________________________________________________

Rubi [A]  time = 0.0253417, antiderivative size = 21, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.095, Rules used = {3629, 8} \[ x (-(a-b))-\frac{a \cot (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]^2*(a + b*Tan[e + f*x]^2),x]

[Out]

-((a - b)*x) - (a*Cot[e + f*x])/f

Rule 3629

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[
((A*b^2 + a^2*C)*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)*(a^2 + b^2)), x] + Dist[1/(a^2 + b^2), Int[(a + b*
Tan[e + f*x])^(m + 1)*Simp[a*(A - C) - (A*b - b*C)*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, C}, x] &&
 NeQ[A*b^2 + a^2*C, 0] && LtQ[m, -1] && NeQ[a^2 + b^2, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \cot ^2(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=-\frac{a \cot (e+f x)}{f}+\int (-a+b) \, dx\\ &=-(a-b) x-\frac{a \cot (e+f x)}{f}\\ \end{align*}

Mathematica [C]  time = 0.0180674, size = 34, normalized size = 1.62 \[ b x-\frac{a \cot (e+f x) \text{Hypergeometric2F1}\left (-\frac{1}{2},1,\frac{1}{2},-\tan ^2(e+f x)\right )}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]^2*(a + b*Tan[e + f*x]^2),x]

[Out]

b*x - (a*Cot[e + f*x]*Hypergeometric2F1[-1/2, 1, 1/2, -Tan[e + f*x]^2])/f

________________________________________________________________________________________

Maple [A]  time = 0.034, size = 31, normalized size = 1.5 \begin{align*}{\frac{b \left ( fx+e \right ) +a \left ( -\cot \left ( fx+e \right ) -fx-e \right ) }{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)^2*(a+b*tan(f*x+e)^2),x)

[Out]

1/f*(b*(f*x+e)+a*(-cot(f*x+e)-f*x-e))

________________________________________________________________________________________

Maxima [A]  time = 1.66738, size = 36, normalized size = 1.71 \begin{align*} -\frac{{\left (f x + e\right )}{\left (a - b\right )} + \frac{a}{\tan \left (f x + e\right )}}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^2*(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

-((f*x + e)*(a - b) + a/tan(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 1.02883, size = 68, normalized size = 3.24 \begin{align*} -\frac{{\left (a - b\right )} f x \tan \left (f x + e\right ) + a}{f \tan \left (f x + e\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^2*(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

-((a - b)*f*x*tan(f*x + e) + a)/(f*tan(f*x + e))

________________________________________________________________________________________

Sympy [A]  time = 1.40587, size = 46, normalized size = 2.19 \begin{align*} \begin{cases} \tilde{\infty } a x & \text{for}\: \left (e = 0 \vee e = - f x\right ) \wedge \left (e = - f x \vee f = 0\right ) \\x \left (a + b \tan ^{2}{\left (e \right )}\right ) \cot ^{2}{\left (e \right )} & \text{for}\: f = 0 \\- a x - \frac{a}{f \tan{\left (e + f x \right )}} + b x & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)**2*(a+b*tan(f*x+e)**2),x)

[Out]

Piecewise((zoo*a*x, (Eq(e, 0) | Eq(e, -f*x)) & (Eq(f, 0) | Eq(e, -f*x))), (x*(a + b*tan(e)**2)*cot(e)**2, Eq(f
, 0)), (-a*x - a/(f*tan(e + f*x)) + b*x, True))

________________________________________________________________________________________

Giac [B]  time = 1.32599, size = 62, normalized size = 2.95 \begin{align*} -\frac{2 \,{\left (f x + e\right )}{\left (a - b\right )} - a \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + \frac{a}{\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^2*(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

-1/2*(2*(f*x + e)*(a - b) - a*tan(1/2*f*x + 1/2*e) + a/tan(1/2*f*x + 1/2*e))/f